﻿#ifndef WIDGET_H
#define WIDGET_H

#include <libdaq/device/DAQ331M/daq_331_m.h>

#include <QTimer>
#include <QWidget>

//#define USE_MODBUS
#define USE_TCP_CLIENT
//#define USE_RS485

using namespace libdaq::device;

QT_BEGIN_NAMESPACE
namespace Ui { class Widget; }
QT_END_NAMESPACE

class Widget : public QWidget {
Q_OBJECT

public:
  Widget(QWidget *parent = nullptr);

  ~Widget();

private slots:

  void ProcessData();

  void on_ConnectPushButton_clicked();

  void on_StartPushButton_clicked();

  void on_StopPushButton_clicked();

private:
  Ui::Widget *ui;
  DAQ331M daq331m;
  QTimer *timer_;
  uint8_t channel_state = 0xFF;

  QVector<QColor> channel_color_list_ = {
      Qt::black, Qt::red, Qt::blue, Qt::darkGreen,
      QColor(0, 197, 205), Qt::magenta, QColor(139, 69, 19), QColor(255, 165, 0),
  };
};

#endif // WIDGET_H
